package com.feicheng.controller.main.admin.store;


import com.feicheng.common.result.ResultInfo;
import com.feicheng.persistence.model.AccessRecordMain;
import com.feicheng.service.IFStoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cailongyang
 * @since 2021-12-02
 */
@RestController
@RequestMapping("/main/admin/store/access_record")
public class AccessRecordController {
    @Autowired
    IFStoreService ifStoreService;

    /**
     * 分页查询门禁记录
     * @param accessRecordMain 查询的检索条件，根据客户名称模糊查询，根据门店id查询，根据门禁设备出入查询，根据时间查询
     * @param current 当前页的页码
     * @param size 一页显示的记录数量
     * @return 当前页门禁记录
     */
    @GetMapping("/page")
    public ResultInfo getAccessRecordByPage(
            AccessRecordMain accessRecordMain,
            @RequestParam(defaultValue = "1") Integer current,
            @RequestParam(defaultValue = "10") Integer size
    ) {
        return ifStoreService.getAccessRecordByPage(accessRecordMain, current, size);
    }
}
